package com.sinven.daoImpl;

import com.sinven.dao.OrderGoodsDao;
import com.sinven.entity.OrderGoods;
import com.sinven.util.HibernateUtil;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.orm.hibernate5.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("OrderGoodsDao")
public class OrderGoodsDaoImpl implements OrderGoodsDao {
    public OrderGoodsDaoImpl(){}

    @Autowired
    @Qualifier("hibernateTemplate")
    private HibernateTemplate hibernateTemplate;

    @Autowired
    @Qualifier("sessionFactory")
    private SessionFactory sessionFactory;
    @Override
    public List<OrderGoods> findOrG(OrderGoods orderGoods,String hql ) {
        Session session= sessionFactory.getCurrentSession();
        Query query=session.createQuery(hql);
        query.setParameter("",orderGoods);
        return  query.list();
    }

    @Override
    public Integer sava(OrderGoods orderGoods ,String hql) {
        return null;
    }

    @Override
    public void addOG(List<OrderGoods> orderGoods, String hql) {

    }

    @Override
    public void updata(List<OrderGoods> orderGoods, String hql) {

    }

    @Override
    public void delect(int id, String hql) {

    }
}
